"""Drop the key column of the api_keys table

Revision ID: 0846452f51ac
Revises: c5978747c602
Create Date: 2025-04-15 09:30:48.205741+00:00

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '0846452f51ac'
down_revision: Union[str, None] = 'c5978747c602'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('api_keys_key_key', 'api_keys', type_='unique')
    op.drop_column('api_keys', 'key')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('api_keys', sa.Column('key', sa.VARCHAR(length=255), autoincrement=False, nullable=False))
    op.create_unique_constraint('api_keys_key_key', 'api_keys', ['key'])
    # ### end Alembic commands ###
